
layui.use(['layer','laydate'], function(){

});

var wnAppUserConsoleGrid =new consoleGrid({table_id:"wnAppUser"});
wnAppUserConsoleGrid.init();
function wnAppUserTableOperate(value){
return "<button type='button' class='btn btn-xs btn-default command-edit' onclick='consoleOpenWindow(\"wnAppUser\",\"/console/wn_app_user/edit?id="+value+"\",\"编辑\")'><span class='glyphicon glyphicon-pencil'></span></button> ";
}
function wnAppUserLoadParam(params){
params.query=wnAppUserQueryString();
return params;
}
function wnAppUserQueryString() {
var objQuery = new Object();
    objQuery.nickName=$('#nickName').val()==''?null:$('#nickName').val(); 
     objQuery.phoneNumber=$('#phoneNumber').val()==''?null:$('#phoneNumber').val(); 
     objQuery.password=$('#password').val()==''?null:$('#password').val(); 
     objQuery.isDel=$('#isDel').val()==''?null:$('#isDel').val(); 
     objQuery.sourceChannel=$('#sourceChannel').val()==''?null:$('#sourceChannel').val(); 
     objQuery.userType=$('#userType').val()==''?null:$('#userType').val();
 
var queryString = JSON.stringify(objQuery);
return queryString;
}

 function wnAppUseris_delFormatter(value) 
   { 
       var showValue=''; 
       switch(value+''){
       case '0': 
       showValue = '否';
       break;
       case '1': 
       showValue = '是';
       break;
       }
    if(showValue.indexOf('不')!=-1||showValue.indexOf('否')!=-1||showValue.indexOf('禁')!=-1){    
       return '<span class="label label-warning">'+showValue+'</span>';
   }else{
       return '<span class="label label-info">'+showValue+'</span>';
   }
   }
 function wnAppUsersource_channelFormatter(value) 
   { 
       var showValue=''; 
       switch(value+''){
       case 'app': 
       showValue = 'app注册';
       break;
       case 'console': 
       showValue = '后台录入';
       break;
       }
    if(showValue.indexOf('不')!=-1||showValue.indexOf('否')!=-1||showValue.indexOf('禁')!=-1){    
       return '<span class="label label-warning">'+showValue+'</span>';
   }else{
       return '<span class="label label-info">'+showValue+'</span>';
   }
   }
 function wnAppUseruser_tyepFormatter(value) 
   { 
       var showValue=''; 
       switch(value+''){
       case '1': 
       showValue = 'app用户';
       break;
       case '2': 
       showValue = '农机用户';
       break;
       }
    if(showValue.indexOf('不')!=-1||showValue.indexOf('否')!=-1||showValue.indexOf('禁')!=-1){    
       return '<span class="label label-warning">'+showValue+'</span>';
   }else{
       return '<span class="label label-info">'+showValue+'</span>';
   }
   }
